myApp.controller('emailController', function ($scope, $http) {
    $scope.sendEmail = function () {
        /*var form = new FormData();
        var file = document.getElementById("pathName").files[0];
        form.append('file', file);*/
       /* if ($scope.pg.consignee == null || $scope.pg.consignee == undefined ||
            $scope.pg.content == null || $scope.pg.content == undefined) {
            alert('发件人或内容不能为空！！！');
            return false;
        } else {*/
            $http({
                url: "/sendEmail",
                method: "post",
                dataType: 'json',
                contentType: 'application/json',
                //data: form,
                data: $scope.pg
            })
                .success(function (data) {
                    alert(data.message);
                    window.location.reload(false);
                });
        }


    /*}*/
});
